<template>
	<view class="task">
		<view class="navigationBar">
			<tui-icon name="arrowleft" color="#ffffff" :size="50" class="navIcon" @click="tolastPage"></tui-icon>
			<view class="navText">任务详情</view>
		</view>
		<view class="conter">
			<view class="title">
				<view class="titleLeft">事件名称:</view>
				<view class="titleRight">
					<span style="background: #fe7a21;">待完成</span>
					
<!-- 					<span style="background: #d9001b;" v-if="item.state == '1'">待接收</span>
					<span style="background: #fe7a21;" v-else-if="item.state == '2'">待完成</span>
					<span style="background: #137a29;" v-else>已完成</span>
 -->				</view>
			</view>
			<view class="titlecon">事件名称事件名称事件名称</view>
			<view class="conterList">事发地址：XX村</view>
			<view class="conterList">事发时间：XX村</view>
			<view class="conterList">事件描述：XX村</view>
			<view class="conterList">涉及人数：XX村</view>
			<view class="conterList">事件级别：XX村</view>
		</view>
		<view class="detaBut">
			<span @click="towanderAbout('1')">流转</span>
			<span @click="towanderAbout('2')">驳回</span>
		</view>
		<view v-if="showdialog" class="showDialog">
			<view class="boxWc">
				<view class="notification">
					<!-- 流转 -->
					<view class="notificationcon" v-if="ciriOrReject">
						<view class="showhide" @click="showdialog = false">关闭</view>
						<view class="notificationText">
							<span class="notificationTextspan">任务已成功接收，请及时流转</span>
							<select v-model="ryName" class="notificationInput">
								<option value="" disabled selected hidden>请选择</option>
							    <option value="一级">一级</option>
							    <option value="二级">二级</option>
							    <option value="三级">三级</option>
								<option value="四级">四级</option>
							  </select>
						</view>
						<view class="notificationBut">
							<span @click="hideDialog('1')">上报</span>
							<span @click="hideDialog('2')">下发</span>
						</view>
					</view>
					<!-- 驳回 -->
					<view class="notificationcon" v-if="!ciriOrReject">
						<view class="notificationconinput">
							<input v-model="rejectReason" class="notInput" type="text" placeholder="请输入驳回理由" />
						</view>
						<view class="notificationButReject">
							<span @click="showdialog = false">取消</span>
							<span @click="hideDialog('3')">确定驳回</span>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>

	export default {
		components: {
		},
		data() {
			return {
				showdialog:false,
				ciriOrReject:true,
				ryName:'',
				rejectReason:''
			};
		},
		computed: {},
		onLoad() {},
		onUnload() {},
		onShow() {
			
		},
		mounted() {
			  uni.$on('eventName', (params) => {
				console.log(params.uid)
			  });
		},
		methods: {
			tolastPage(){
				wx.navigateBack({
				  delta: 1 
				})
			},
			towanderAbout(value){
				if(value == '1'){
					this.ciriOrReject = true
				}else{
					this.ciriOrReject = false
				}
				this.showdialog = true
			},
			hideDialog(value){
				if(value == '1'){
					console.log('上报成功')
				}else if(value == '2'){
					console.log('下发成功')
				}else{
					console.log('驳回成功')
				}
				this.showdialog = false
			}
		}
	}
</script>

<style lang="scss">
	.task{height: 100vh; background: rgb(224, 225, 225);}
	.navigationBar{position: relative; display: flex; justify-content: center; align-items: center; width: 100%; height: 180rpx; background: url('../../static/imgs/headbg.png') no-repeat; background-size: 100% 100%;
		.navIcon{position: absolute; left: 0;}
		.navText{font-size: 45rpx;}
	}
	.conter{padding:30rpx 30rpx 50rpx 30rpx; height: calc(100% - 180rpx - 300rpx); overflow-y: auto;
		.title{display: flex; align-items: center; justify-content: space-between;
			.titleLeft{font-size: 43rpx; font-weight: bold; color:#333333;}
			.titleRight{text-align: right;
				span{padding: 5rpx 15rpx; color: #ffffff; border-radius: 10rpx;}
			}
		}
		.titlecon{font-size: 43rpx; font-weight: bold; color:#333333; margin-bottom: 30rpx;}
		.conterList{margin: 30rpx 0; font-family: 'PingFangSC-Regular', 'PingFang SC', sans-serif; font-weight: 400;  font-style: normal; color: #959CA6; font-size: 30rpx;}
	}
	.detaBut{ margin-top: 30rpx; text-align: center;
		span{padding: 20rpx 100rpx; border-radius: 15rpx; font-size: 35rpx; margin: 0 30rpx;}
		span:nth-child(1){ color: #ffffff;  background: linear-gradient(90deg, rgba(23, 72, 244, 1) 0%, rgba(46, 127, 243, 1) 100%);}
		span:nth-child(2){ color: #333333;  background: #ffffff; border: 1rpx solid rgba(2, 167, 240, 1);}
		
	}
	.showDialog{position: fixed; top: 0; width: 100%; height: 100%; z-index: 9999;
		.boxWc{position: relative; width: 100%; height: 100%;
			.notification{ position: absolute; left: 30rpx; top: calc(50% - 225rpx); height: 500rpx; width: calc(100% - 60rpx); background: #ffffff; border-radius: 15rpx; box-shadow:2px 2px 5px rgba(0, 0, 0, 0.349019607843137);
				.notificationcon{position: relative; width: 100%; height: 100%;
					.showhide{position: absolute; top: 10rpx; right: 10rpx; font-size: 28rpx;}
					.notificationText{text-align: center; padding-top: 80rpx;
						.notificationTextspan{display: block; font-size: 45rpx;}
						.notificationInput{margin-top: 50rpx; padding-left: 30rpx; height: 75rpx; width: calc(100% - 150rpx);}
					}
					.notificationBut{ position: absolute; width: 100%; bottom: 80rpx; text-align: center;
						span{padding: 20rpx 100rpx; border-radius: 15rpx; font-size: 35rpx; margin: 0 30rpx;}
						span:nth-child(1){color: #ffffff; background: linear-gradient(90deg, rgba(23, 72, 244, 1) 0%, rgba(46, 127, 243, 1) 100%);}
						span:nth-child(2){color: #333333; background: #ffffff; border: 1rpx solid rgba(2, 167, 240, 1);}
					}
					.notificationconinput{ padding-top:80rpx;
						.notInput{margin-left: 30rpx; box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.349019607843137); background: rgb(245, 246, 247); border-radius: 10rpx; height:130rpx; width: calc(100% - 70rpx); padding-left: 20rpx;}
					}
					.notificationButReject{position: absolute; width: 100%; bottom: 80rpx; text-align: center;
						span{ border-radius: 15rpx; font-size: 35rpx; margin: 0 30rpx;}
						span:nth-child(1){padding: 20rpx 100rpx; color: #ffffff; background: linear-gradient(90deg, rgba(23, 72, 244, 1) 0%, rgba(46, 127, 243, 1) 100%);}
						span:nth-child(2){padding: 20rpx 70rpx; color: #333333; background: #ffffff; border: 1rpx solid rgba(2, 167, 240, 1);}
					}
				}
			}
		}
	}
</style>